package com.chujiekeji.test.fragment.friend;

import com.chujiekeji.test.adapter.BaseRecyclerAdapter;
import com.chujiekeji.test.adapter.friend.FenSiAdapter;
import com.chujiekeji.test.api.ChujieApi;
import com.chujiekeji.test.bean.PageBean;
import com.chujiekeji.test.bean.ResultBean;
import com.chujiekeji.test.bean.friend.FenSi;
import com.chujiekeji.test.fragment.base.BaseRecyclerViewFragment;
import com.chujiekeji.test.util.TLog;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;

public class FenSiFragment extends BaseRecyclerViewFragment<FenSi> {
	@Override
	protected BaseRecyclerAdapter<FenSi> getRecyclerAdapter() {
		return new FenSiAdapter(getContext(), BaseRecyclerAdapter.ONLY_FOOTER);
	}

	@Override
	protected Type getType() {
		return new TypeToken<ResultBean<PageBean<FenSi>>>() {
		}.getType();
	}

	@Override
	protected void requestData() {
		super.requestData();
		ChujieApi.fetchPengYou(isRefreshing ? 1 : (mBean.getNextPage()==null?1:mBean.getNextPage()),20,1,mHandler);
		TLog.i("Fensi","onFinish");
	}

}
